/**
 * 
 */
package org.theqcp.wow.sim.engine.revised;

import java.io.Serializable;

import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.helpers.NullEnumeration;

/**
 * Core logic for Simulation.
 * 
 * @author bhamlin
 */
public class Simulation implements Serializable {

    private static final long serialVersionUID = 4876968863907748668L;
    private static final String logPattern = "%-5p[%t|%c]:%m%n";

    static {
	if( LogManager.getRootLogger().getAllAppenders().getClass().equals(NullEnumeration.class) ) {
	    PatternLayout pattern = new PatternLayout(logPattern);
	    ConsoleAppender console = new ConsoleAppender(pattern);
	    Logger rootLogger = LogManager.getRootLogger();
	    rootLogger.addAppender(console);
	} else {
	    LogManager.getRootLogger().debug("Using already configured logger.");
	}
    }

    protected final Logger log = LogManager.getLogger(getClass().getSimpleName());
    protected final ThreadGroup threadGroup;
    protected long simulationTime;

    public Simulation() {
	this.threadGroup = new ThreadGroup("Skywall#Sheripiari");
    }

    public static void main( String... args ) {
	new Simulation().start();
    }

    public void start() {
	// SimulationParameters sparam;
	// Player p = new Player();

	// sparam = new SimulationParameters(p);

	// sparam.simulationTime = 100000;

	// p.damageRotation.add(Event.StormStrike);
	// p.damageRotation.add(Event.LavaLash);
	// p.damageRotation.add(Event.LightningBoltWithMaelstrom5);
	// p.damageRotation.add(Event.AutoAttackMainHand);
	// p.damageRotation.add(Event.AutoAttackOffHand);

	// p.thinks.put(Event.StormStrike, 8000l);
	// p.thinks.put(Event.LavaLash, 6000l);
	// p.thinks.put(Event.AutoAttackMainHand, 2500l);
	// p.thinks.put(Event.AutoAttackOffHand, 2500l);

	// new Thread(threadGroup, new SimulationThread(sparam),
	// "Simulation").start();
    }

}
